package com.populateshootertest;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;

public class Demo extends Activity {
    ImageView mImageView;
	int i;
	int[] tag;
	int delay = 100;
    
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mImageView = (ImageView) findViewById(R.id.ImageView01);
        i = 0;
        tag = new int[10];
        tag[0] = R.drawable.zomb_wolk0;
        tag[1] = R.drawable.zomb_wolk1;
        tag[2] = R.drawable.zomb_wolk2;
        tag[3] = R.drawable.zomb_wolk3;
        tag[4] = R.drawable.zomb_wolk4;
        tag[5] = R.drawable.zomb_wolk5;
        tag[6] = R.drawable.zomb_wolk6;
        tag[7] = R.drawable.zomb_wolk7;
        tag[8] = R.drawable.zomb_wolk8;
        tag[9] = R.drawable.zomb_wolk9;
        
        TimerTask task = new TimerTask() {
			@Override
			public void run() {
				mImageView.post(new Runnable() {
					
					@Override
					public void run() {
						mImageView.setImageResource(tag[i]);
						
						i++;
						if (i > 9) {
							i = 0;
						}
					}
				});
			}
		};
        Timer time = new Timer();
        time.schedule(task, delay, delay);
    }
}